<?php

namespace App\Http\Requests\PC\BosImageUpload;

use App\Http\Requests\ApiRequest;
use Illuminate\Http\UploadedFile;

/**
 * @property UploadedFile[] images
 * @property string bos_dir
 * @property string keep_name
 */
class MultiBosImageStoreRequest extends ApiRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'images.*'     => 'required|file',
            'images'       => 'required|array|min:1',
            'bos_dir'     => 'required|string',
            'keep_name'   => 'nullable|boolean',
        ];
    }

    /**
     * @return array
     */
//    public function messages()
//    {
//        return [
//            'images.*.*'   => '图片必须是文件',
//            'images.*'     => '图片文件必须是数组',
//        ];
//    }

}
